﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Windows.Forms;
using System.Drawing;

namespace AcesHigh.GUI
{
    class PictureCard : PictureBox
    {
        private Card card;
        private String faceUpImage;
        private String faceDownImage;

        public Suit CardSuit
        {
            get { return card.Suit; }
        }

        public Rank CardRank
        {
            get { return card.Rank; }
        }

        public bool IsLowerValue(PictureCard card)
        {
            return ((card != null) && this.card.IsLowerValue(card.card));
        }
        
        public PictureCard(Card card, String faceUpImage) : this(card, faceUpImage, null)
        { }

        public PictureCard(Card card, String faceUpImage, String faceDownImage)
        {
            this.card = card;
            this.faceUpImage = faceUpImage;
            this.faceDownImage = faceDownImage;
        }

        internal void showFaceUpImage()
        {
            this.Image = new Bitmap(faceUpImage);
        }

        internal void showFaceDownImage()
        {
            if (faceDownImage != null)
            {
                this.Image = new Bitmap(faceDownImage);
            }
        }
    }
}
